package com.usian.behavior.controller;

import com.usian.apis.behavior.ApReadBehaviorControllerApi;
import com.usian.behavior.service.ApReadBehaviorService;
import com.usian.model.article.dtos.ArticleInfoDto;
import com.usian.model.behavior.dtos.ReadBehaviorDto;
import com.usian.model.behavior.pojos.ApReadBehavior;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: ApReadBehaviorController
 * Author:   WGG
 * Date:    2022-12-2022/12/1-15:29
 * Version: 1.0
 * Description:
 */
@RestController
@RequestMapping("/behavior/api/v1")
public class ApReadBehaviorController implements ApReadBehaviorControllerApi {

    @Autowired
    private ApReadBehaviorService apReadBehaviorService;

    @Override
    @PostMapping("/read_behavior")
    public ResponseResult readBehavior(@RequestBody ReadBehaviorDto dto) {
        return apReadBehaviorService.readBehavior(dto);
    }

    @Override
    @PostMapping("/show_read_behavior")
    public ApReadBehavior showReadBehavior(@RequestBody ArticleInfoDto dto) {
        return apReadBehaviorService.showReadBehavior(dto);
    }
}
